﻿// -----------------------------------------------------------------------
// <copyright file="MySimpleClass.cs" company="none">
// Copyright (c) 2012 M. Alberti, xanatos(at)live.it
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
// </copyright>
// -----------------------------------------------------------------------

namespace FluentSerializer.Sample
{
    using System.Linq.Expressions;
    using FluentSerializer;
    using FluentStatement;

    /// <summary>
    /// 
    /// </summary>
    [FluentSerializable(typeof(MySimpleClass.Serializer))]
    public class MySimpleClass
    {
        /// <summary>
        /// 
        /// </summary>
        public int Int1 { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public class Serializer : ISerializer<MySimpleClass, EmptyParameters>
        {
            #region ISerializer<MySimpleClass,EmptyParameters> Members

            /// <summary>
            /// 
            /// </summary>
            /// <returns></returns>
            public Expression<Serializer<MySimpleClass, EmptyParameters>> GetSerializer()
            {
                return (op, obj, par) => Statement.Start(fl => fl
                    .Serialize(obj.Int1)

                    .Empty());
            }

            #endregion
        }
    }
}
